Registered S3 methods overwritten by 'dbplyr':
  method         from
  print.tbl_lazy     
  print.tbl_sql      
-- Attaching packages ---------------------------------------------------------------- tidyverse 1.3.1 --
√ ggplot2 3.3.5     √ purrr   0.3.4
√ tibble  3.1.6     √ dplyr   1.0.8
√ tidyr   1.2.0     √ stringr 1.4.0
√ readr   2.1.2     √ forcats 0.5.1
-- Conflicts ------------------------------------------------------------------- tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()

Attaching package: ‘scales’

The following object is masked from ‘package:purrr’:

    discard

The following object is masked from ‘package:readr’:

    col_factor

Registered S3 method overwritten by 'data.table':
  method           from
  print.data.table     
Registered S3 methods overwritten by 'htmltools':
  method               from         
  print.html           tools:rstudio
  print.shiny.tag      tools:rstudio
  print.shiny.tag.list tools:rstudio
Registered S3 method overwritten by 'htmlwidgets':
  method           from         
  print.htmlwidget tools:rstudio

Attaching package: ‘plotly’

The following object is masked from ‘package:ggplot2’:

    last_plot

The following object is masked from ‘package:stats’:

    filter

The following object is masked from ‘package:graphics’:

    layout

data.table 1.14.2 using 8 threads (see ?getDTthreads).  Latest news: r-datatable.com

Attaching package: ‘data.table’

The following objects are masked from ‘package:dplyr’:

    between, first, last

The following object is masked from ‘package:purrr’:

    transpose


Attaching package: ‘lubridate’

The following objects are masked from ‘package:data.table’:

    hour, isoweek, mday, minute, month, quarter, second, wday, week, yday, year

The following objects are masked from ‘package:base’:

    date, intersect, setdiff, union
Rows: 166326 Columns: 67
-- Column specification ---------------------------------------------------------------------------------
Delimiter: ","
chr   (4): iso_code, continent, location, tests_units
dbl  (62): total_cases, new_cases, new_cases_smoothed, total_deaths, new_deaths, new_deaths_smoothed,...
date  (1): date

i Use `spec()` to retrieve the full column specification for this data.
i Specify the column types or set `show_col_types = FALSE` to quiet this message.
Rows: 100416 Columns: 6
-- Column specification ---------------------------------------------------------------------------------
Delimiter: ","
chr  (2): location, variant
dbl  (3): num_sequences, perc_sequences, num_sequences_total
date (1): date

i Use `spec()` to retrieve the full column specification for this data.
i Specify the column types or set `show_col_types = FALSE` to quiet this message.
nrow(covid)
[1] 166326
covid$location %>% 
  unique()
  [1] "Afghanistan"                      "Africa"                          
  [3] "Albania"                          "Algeria"                         
  [5] "Andorra"                          "Angola"                          
  [7] "Anguilla"                         "Antigua and Barbuda"             
  [9] "Argentina"                        "Armenia"                         
 [11] "Aruba"                            "Asia"                            
 [13] "Australia"                        "Austria"                         
 [15] "Azerbaijan"                       "Bahamas"                         
 [17] "Bahrain"                          "Bangladesh"                      
 [19] "Barbados"                         "Belarus"                         
 [21] "Belgium"                          "Belize"                          
 [23] "Benin"                            "Bermuda"                         
 [25] "Bhutan"                           "Bolivia"                         
 [27] "Bonaire Sint Eustatius and Saba"  "Bosnia and Herzegovina"          
 [29] "Botswana"                         "Brazil"                          
 [31] "British Virgin Islands"           "Brunei"                          
 [33] "Bulgaria"                         "Burkina Faso"                    
 [35] "Burundi"                          "Cambodia"                        
 [37] "Cameroon"                         "Canada"                          
 [39] "Cape Verde"                       "Cayman Islands"                  
 [41] "Central African Republic"         "Chad"                            
 [43] "Chile"                            "China"                           
 [45] "Colombia"                         "Comoros"                         
 [47] "Congo"                            "Cook Islands"                    
 [49] "Costa Rica"                       "Cote d'Ivoire"                   
 [51] "Croatia"                          "Cuba"                            
 [53] "Curacao"                          "Cyprus"                          
 [55] "Czechia"                          "Democratic Republic of Congo"    
 [57] "Denmark"                          "Djibouti"                        
 [59] "Dominica"                         "Dominican Republic"              
 [61] "Ecuador"                          "Egypt"                           
 [63] "El Salvador"                      "Equatorial Guinea"               
 [65] "Eritrea"                          "Estonia"                         
 [67] "Eswatini"                         "Ethiopia"                        
 [69] "Europe"                           "European Union"                  
 [71] "Faeroe Islands"                   "Falkland Islands"                
 [73] "Fiji"                             "Finland"                         
 [75] "France"                           "French Polynesia"                
 [77] "Gabon"                            "Gambia"                          
 [79] "Georgia"                          "Germany"                         
 [81] "Ghana"                            "Gibraltar"                       
 [83] "Greece"                           "Greenland"                       
 [85] "Grenada"                          "Guatemala"                       
 [87] "Guernsey"                         "Guinea"                          
 [89] "Guinea-Bissau"                    "Guyana"                          
 [91] "Haiti"                            "High income"                     
 [93] "Honduras"                         "Hong Kong"                       
 [95] "Hungary"                          "Iceland"                         
 [97] "India"                            "Indonesia"                       
 [99] "International"                    "Iran"                            
[101] "Iraq"                             "Ireland"                         
[103] "Isle of Man"                      "Israel"                          
[105] "Italy"                            "Jamaica"                         
[107] "Japan"                            "Jersey"                          
[109] "Jordan"                           "Kazakhstan"                      
[111] "Kenya"                            "Kiribati"                        
[113] "Kosovo"                           "Kuwait"                          
[115] "Kyrgyzstan"                       "Laos"                            
[117] "Latvia"                           "Lebanon"                         
[119] "Lesotho"                          "Liberia"                         
[121] "Libya"                            "Liechtenstein"                   
[123] "Lithuania"                        "Low income"                      
[125] "Lower middle income"              "Luxembourg"                      
[127] "Macao"                            "Madagascar"                      
[129] "Malawi"                           "Malaysia"                        
[131] "Maldives"                         "Mali"                            
[133] "Malta"                            "Marshall Islands"                
[135] "Mauritania"                       "Mauritius"                       
[137] "Mexico"                           "Micronesia (country)"            
[139] "Moldova"                          "Monaco"                          
[141] "Mongolia"                         "Montenegro"                      
[143] "Montserrat"                       "Morocco"                         
[145] "Mozambique"                       "Myanmar"                         
[147] "Namibia"                          "Nauru"                           
[149] "Nepal"                            "Netherlands"                     
[151] "New Caledonia"                    "New Zealand"                     
[153] "Nicaragua"                        "Niger"                           
[155] "Nigeria"                          "Niue"                            
[157] "North America"                    "North Macedonia"                 
[159] "Northern Cyprus"                  "Norway"                          
[161] "Oceania"                          "Oman"                            
[163] "Pakistan"                         "Palau"                           
[165] "Palestine"                        "Panama"                          
[167] "Papua New Guinea"                 "Paraguay"                        
[169] "Peru"                             "Philippines"                     
[171] "Pitcairn"                         "Poland"                          
[173] "Portugal"                         "Qatar"                           
[175] "Romania"                          "Russia"                          
[177] "Rwanda"                           "Saint Helena"                    
[179] "Saint Kitts and Nevis"            "Saint Lucia"                     
[181] "Saint Pierre and Miquelon"        "Saint Vincent and the Grenadines"
[183] "Samoa"                            "San Marino"                      
[185] "Sao Tome and Principe"            "Saudi Arabia"                    
[187] "Senegal"                          "Serbia"                          
[189] "Seychelles"                       "Sierra Leone"                    
[191] "Singapore"                        "Sint Maarten (Dutch part)"       
[193] "Slovakia"                         "Slovenia"                        
[195] "Solomon Islands"                  "Somalia"                         
[197] "South Africa"                     "South America"                   
[199] "South Korea"                      "South Sudan"                     
[201] "Spain"                            "Sri Lanka"                       
[203] "Sudan"                            "Suriname"                        
[205] "Sweden"                           "Switzerland"                     
[207] "Syria"                            "Taiwan"                          
[209] "Tajikistan"                       "Tanzania"                        
[211] "Thailand"                         "Timor"                           
[213] "Togo"                             "Tokelau"                         
[215] "Tonga"                            "Trinidad and Tobago"             
[217] "Tunisia"                          "Turkey"                          
[219] "Turkmenistan"                     "Turks and Caicos Islands"        
[221] "Tuvalu"                           "Uganda"                          
[223] "Ukraine"                          "United Arab Emirates"            
[225] "United Kingdom"                   "United States"                   
[227] "Upper middle income"              "Uruguay"                         
[229] "Uzbekistan"                       "Vanuatu"                         
[231] "Vatican"                          "Venezuela"                       
[233] "Vietnam"                          "Wallis and Futuna"               
[235] "World"                            "Yemen"                           
[237] "Zambia"                           "Zimbabwe"                        
covid_NAs <- covid %>% 
  group_by(location) %>% 
  summarise_all(funs(sum(is.na(.)))) %>% 
  pivot_longer(cols = -location, names_to = "Variable", values_to = "NAs") %>% 
  mutate(Percent = round(NAs / nrow(covid) * 100 ,2)) %>% 
  arrange(-NAs)
Warning: `funs()` was deprecated in dplyr 0.8.0.
Please use a list of either functions or lambdas: 

  # Simple named list: 
  list(mean = mean, median = median)

  # Auto named with `tibble::lst()`: 
  tibble::lst(mean, median)

  # Using lambdas
  list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
covid_NAs
DT::datatable(
  covid_NAs, filter = 'top',
  #options = list(
 #   columnDefs = list(list(targets = 1, searchable = FALSE))
  #)
)
covid_NAs %>% 
  group_by(location) %>% 
  summarise(total_pct_na = sum(Percent)) %>% 
  arrange(total_pct_na) %>% 
  datatable(filter = 'top')
covid %>% 
  colnames()
 [1] "iso_code"                                   "continent"                                 
 [3] "location"                                   "date"                                      
 [5] "total_cases"                                "new_cases"                                 
 [7] "new_cases_smoothed"                         "total_deaths"                              
 [9] "new_deaths"                                 "new_deaths_smoothed"                       
[11] "total_cases_per_million"                    "new_cases_per_million"                     
[13] "new_cases_smoothed_per_million"             "total_deaths_per_million"                  
[15] "new_deaths_per_million"                     "new_deaths_smoothed_per_million"           
[17] "reproduction_rate"                          "icu_patients"                              
[19] "icu_patients_per_million"                   "hosp_patients"                             
[21] "hosp_patients_per_million"                  "weekly_icu_admissions"                     
[23] "weekly_icu_admissions_per_million"          "weekly_hosp_admissions"                    
[25] "weekly_hosp_admissions_per_million"         "new_tests"                                 
[27] "total_tests"                                "total_tests_per_thousand"                  
[29] "new_tests_per_thousand"                     "new_tests_smoothed"                        
[31] "new_tests_smoothed_per_thousand"            "positive_rate"                             
[33] "tests_per_case"                             "tests_units"                               
[35] "total_vaccinations"                         "people_vaccinated"                         
[37] "people_fully_vaccinated"                    "total_boosters"                            
[39] "new_vaccinations"                           "new_vaccinations_smoothed"                 
[41] "total_vaccinations_per_hundred"             "people_vaccinated_per_hundred"             
[43] "people_fully_vaccinated_per_hundred"        "total_boosters_per_hundred"                
[45] "new_vaccinations_smoothed_per_million"      "new_people_vaccinated_smoothed"            
[47] "new_people_vaccinated_smoothed_per_hundred" "stringency_index"                          
[49] "population"                                 "population_density"                        
[51] "median_age"                                 "aged_65_older"                             
[53] "aged_70_older"                              "gdp_per_capita"                            
[55] "extreme_poverty"                            "cardiovasc_death_rate"                     
[57] "diabetes_prevalence"                        "female_smokers"                            
[59] "male_smokers"                               "handwashing_facilities"                    
[61] "hospital_beds_per_thousand"                 "life_expectancy"                           
[63] "human_development_index"                    "excess_mortality_cumulative_absolute"      
[65] "excess_mortality_cumulative"                "excess_mortality"                          
[67] "excess_mortality_cumulative_per_million"   
head(covid$date)
[1] "2020-02-24" "2020-02-25" "2020-02-26" "2020-02-27" "2020-02-28" "2020-02-29"
summary(variants)
   location              date              variant          num_sequences       perc_sequences   
 Length:100416      Min.   :2020-05-11   Length:100416      Min.   :     0.00   Min.   : -0.010  
 Class :character   1st Qu.:2020-10-26   Class :character   1st Qu.:     0.00   1st Qu.:  0.000  
 Mode  :character   Median :2021-03-22   Mode  :character   Median :     0.00   Median :  0.000  
                    Mean   :2021-03-13                      Mean   :    72.17   Mean   :  6.154  
                    3rd Qu.:2021-07-26                      3rd Qu.:     0.00   3rd Qu.:  0.000  
                    Max.   :2022-01-05                      Max.   :142280.00   Max.   :100.000  
 num_sequences_total
 Min.   :     1     
 1st Qu.:    12     
 Median :    59     
 Mean   :  1510     
 3rd Qu.:   394     
 Max.   :146170     
variants %>%
  filter(location == "United States") %>% 
 ## filter(variant %in% c("Alpha", "Delta", "Omicron")) %>%  
  ggplot(aes(x = date, y = perc_sequences, color = variant)) + 
  geom_line(size = 1, alpha = 0.5) + 
  theme_minimal()

variants %>% 
  filter(location == "United States", date == max(date)) %>% 
  arrange(-perc_sequences)
variants$date
   [1] "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06"
   [8] "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06"
  [15] "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06"
  [22] "2020-07-06" "2020-07-06" "2020-07-06" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31"
  [29] "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31"
  [36] "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31"
  [43] "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-09-28"
  [50] "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28"
  [57] "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28"
  [64] "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28"
  [71] "2020-09-28" "2020-09-28" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12"
  [78] "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12"
  [85] "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12"
  [92] "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-26" "2020-10-26"
  [99] "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26"
 [106] "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26"
 [113] "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26"
 [120] "2020-10-26" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07"
 [127] "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07"
 [134] "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07"
 [141] "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-07" "2020-12-21" "2020-12-21" "2020-12-21"
 [148] "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21"
 [155] "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21"
 [162] "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21" "2020-12-21"
 [169] "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04"
 [176] "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04"
 [183] "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-04"
 [190] "2021-01-04" "2021-01-04" "2021-01-04" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11"
 [197] "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11"
 [204] "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11"
 [211] "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-11" "2021-01-25"
 [218] "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25"
 [225] "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25"
 [232] "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25" "2021-01-25"
 [239] "2021-01-25" "2021-01-25" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08"
 [246] "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08"
 [253] "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08"
 [260] "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-08" "2021-02-22" "2021-02-22"
 [267] "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22"
 [274] "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22"
 [281] "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22" "2021-02-22"
 [288] "2021-02-22" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08"
 [295] "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08"
 [302] "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08"
 [309] "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-08" "2021-03-22" "2021-03-22" "2021-03-22"
 [316] "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22"
 [323] "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22"
 [330] "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22" "2021-03-22"
 [337] "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05"
 [344] "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05"
 [351] "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-05"
 [358] "2021-04-05" "2021-04-05" "2021-04-05" "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19"
 [365] "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19"
 [372] "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19"
 [379] "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19" "2021-04-19" "2021-05-03"
 [386] "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03"
 [393] "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03"
 [400] "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03" "2021-05-03"
 [407] "2021-05-03" "2021-05-03" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17"
 [414] "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17"
 [421] "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17"
 [428] "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-17" "2021-05-31" "2021-05-31"
 [435] "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31"
 [442] "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31"
 [449] "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31" "2021-05-31"
 [456] "2021-05-31" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14"
 [463] "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14"
 [470] "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14"
 [477] "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-14" "2021-06-28" "2021-06-28" "2021-06-28"
 [484] "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28"
 [491] "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28"
 [498] "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28" "2021-06-28"
 [505] "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12"
 [512] "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12"
 [519] "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-12"
 [526] "2021-07-12" "2021-07-12" "2021-07-12" "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26"
 [533] "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26"
 [540] "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26"
 [547] "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26" "2021-07-26" "2021-08-09"
 [554] "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09"
 [561] "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09"
 [568] "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09" "2021-08-09"
 [575] "2021-08-09" "2021-08-09" "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23"
 [582] "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23"
 [589] "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23"
 [596] "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23" "2021-08-23" "2021-09-06" "2021-09-06"
 [603] "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06"
 [610] "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06"
 [617] "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06" "2021-09-06"
 [624] "2021-09-06" "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20"
 [631] "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20"
 [638] "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20"
 [645] "2021-09-20" "2021-09-20" "2021-09-20" "2021-09-20" "2021-10-04" "2021-10-04" "2021-10-04"
 [652] "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04"
 [659] "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04"
 [666] "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04" "2021-10-04"
 [673] "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11"
 [680] "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11"
 [687] "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-11"
 [694] "2020-05-11" "2020-05-11" "2020-05-11" "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25"
 [701] "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25"
 [708] "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25"
 [715] "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25" "2020-05-25" "2020-06-08"
 [722] "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08"
 [729] "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08"
 [736] "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08" "2020-06-08"
 [743] "2020-06-08" "2020-06-08" "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22"
 [750] "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22"
 [757] "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22"
 [764] "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22" "2020-06-22" "2020-07-06" "2020-07-06"
 [771] "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06"
 [778] "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06"
 [785] "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06" "2020-07-06"
 [792] "2020-07-06" "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20"
 [799] "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20"
 [806] "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20"
 [813] "2020-07-20" "2020-07-20" "2020-07-20" "2020-07-20" "2020-08-03" "2020-08-03" "2020-08-03"
 [820] "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03"
 [827] "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03"
 [834] "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03" "2020-08-03"
 [841] "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17"
 [848] "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17"
 [855] "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-17"
 [862] "2020-08-17" "2020-08-17" "2020-08-17" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31"
 [869] "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31"
 [876] "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31"
 [883] "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-08-31" "2020-09-14"
 [890] "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14"
 [897] "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14"
 [904] "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14" "2020-09-14"
 [911] "2020-09-14" "2020-09-14" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28"
 [918] "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28"
 [925] "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28"
 [932] "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-09-28" "2020-10-12" "2020-10-12"
 [939] "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12"
 [946] "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12"
 [953] "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12" "2020-10-12"
 [960] "2020-10-12" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26"
 [967] "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26"
 [974] "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26"
 [981] "2020-10-26" "2020-10-26" "2020-10-26" "2020-10-26" "2020-11-09" "2020-11-09" "2020-11-09"
 [988] "2020-11-09" "2020-11-09" "2020-11-09" "2020-11-09" "2020-11-09" "2020-11-09" "2020-11-09"
 [995] "2020-11-09" "2020-11-09" "2020-11-09" "2020-11-09" "2020-11-09" "2020-11-09"
 [ reached 'max' / getOption("max.print") -- omitted 99416 entries ]
us <- covid %>% 
  filter(location == "United States") 

us_variants <- variants %>% 
  filter(location == "United States")

us <- left_join(us, us_variants, by = "date")
variants_plot <- us %>% 
  ggplot(aes(x = date)) +
  geom_line(aes(y = perc_sequences, color = variant), show.legend = FALSE) +
  geom_vline(aes(xintercept = ymd(20200706)), color = "black") +
  geom_vline(aes(xintercept = ymd(20210517)), color = "black") + 
  geom_vline(aes(xintercept = ymd(20211004)), color = "black") + 
    geom_vline(aes(xintercept = ymd(20220105)), color = "black") + 
  theme_minimal()

cases_plot <- us %>% 
  ggplot(aes(x = date)) +
  geom_line(aes(y = new_cases_per_million), show.legend = FALSE) +
  geom_line(aes(y = new_deaths_per_million)) + 
  geom_vline(aes(xintercept = ymd(20200706)), color = "black") +
  geom_vline(aes(xintercept = ymd(20210517)), color = "black") + 
  geom_vline(aes(xintercept = ymd(20211004)), color = "black") + 
    geom_vline(aes(xintercept = ymd(20220105)), color = "black") + 
  theme_minimal()
ggplotly(variants_plot)
Warning: `gather_()` was deprecated in tidyr 1.2.0.
Please use `gather()` instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
variants_plot
Warning: Removed 729 row(s) containing missing values (geom_path).

cases_plot
Warning: Removed 1 row(s) containing missing values (geom_path).
Warning: Removed 38 row(s) containing missing values (geom_path).

LS0tDQp0aXRsZTogIkNPVklELTE5IERhdGFzZXQgQW5hbHlzaXMiDQpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sNCi0tLQ0KDQpgYGB7ciwgZWNobyA9IEZBTFNFfQ0KbGlicmFyeSh0aWR5dmVyc2UpDQpsaWJyYXJ5KHNjYW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